import 'package:flutter/material.dart';
import 'dart:convert';
import '../model/details.dart';
import '../service/service_method.dart';

class DetailsInfoProvide with ChangeNotifier {
  DetailsModel goodsInfo;
  Future getGoodsInfo(String id) async {
    var formData = {'goodId': id};
    var res = await request('getGoodDetailById', formData: formData);
    var responseData = json.decode(res.toString());
    goodsInfo = DetailsModel.fromJson(responseData);
    notifyListeners();
    return goodsInfo;
  }
}
